<?php
/**
 * common model file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2019/08/20
 * Time: 06:01
 */

namespace HiCommon\Model;

class ViewShopCouponGrantDetail extends Base
{

    protected $table = 'view_shop_coupon_grant_detail';

    protected $guarded = [];

    //public $timestamps = false;

    /**
     * 应该被调整为日期的属性
     *
     * @var array
     */
    protected $dates = [
    ];


    /**
     *  关联商户信息
     *  hinq 2019 09 11
     *
     **/
    public function shop(){
        return $this->belongsTo(Shop::class,'shop_id','id')->select(['name','id','logo']);
    }


    /**
     *  关联优惠券信息
     *  hinq 2019 08 29
     *
     **/
    public function coupon(){
        return $this->belongsTo(Coupons::class,'coupon_id','id')->select(['id','name','price','discount_num','price_all','ticket_num','pid','content','validity_at','status','repairstore_id']);
    }



}